package com.example.ranl_offershow.Service.Impl;

import com.example.ranl_offershow.Dao.OfferDataDao;
import com.example.ranl_offershow.Entity.Data.OfferData;
import com.example.ranl_offershow.Service.OfferDataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class OfferDataServiceImpl implements OfferDataService {
    @Autowired
    private OfferDataDao offerDataDao;

    //查询所有的OfferData
    @Override
    public List<OfferData> getAllOfferData(){
        return offerDataDao.getAllOfferData();
    }

    //根据OfferData id查找
    @Override
    public OfferData getOfferDataById(int id){
        return offerDataDao.getOfferDataById(id);
    }

    //根据OfferData company查找
    public List<OfferData> getOfferDataByCompany(String company){
        return offerDataDao.getOfferDataByCompany(company);
    }

    //增加OfferData
    @Override
    public void createOfferData(OfferData offerData){
        offerDataDao.createOfferData(offerData);
    }

    //更改OfferData数据
    @Override
    public void updateOfferData(OfferData offerData){
        offerDataDao.updateOfferData(offerData);
    }

    //根据OfferData id删除
    @Override
    public void deleteOfferData(int id){
        offerDataDao.deleteOfferData(id);
    }

    //根据OfferData company批量删除
    @Override
    public void deleteBatchOfferData(String company){
        offerDataDao.deleteBatchOfferData(company);
    }
}
